#pragma once
#include <fcntl.h>
#include <iostream>
#include <vector>
#include <stdio.h>
#include <string.h>

class IGoodsPlugin
{
public:
	IGoodsPlugin();
	virtual ~IGoodsPlugin();
	virtual void Print() = 0;
	virtual void PrintInfo() = 0;
	virtual int GetID() = 0;
	virtual char* GetName() = 0;//添加部分
	virtual bool Serialize(FILE* fp) = 0;
    virtual IGoodsPlugin* Deserialize(FILE* fp) = 0;
    virtual bool GetType(int& type) = 0;

	int getPrice();
	int getStock();


public:
	int m_id;
	int m_price;
	int m_stock;
	char *m_name;
};

class objLip: public IGoodsPlugin
{
public:
    objLip();
    virtual ~objLip();
    virtual void Print();
    virtual void PrintInfo();
    virtual int GetID(void);
    virtual char *GetName();
    virtual bool GetType(int& type);
    virtual bool Serialize(FILE *fp);
    virtual IGoodsPlugin* Deserialize(FILE *fp);
};

class objBeer: public IGoodsPlugin
{
public:
    objBeer();
    virtual ~objBeer();
    virtual void Print();
    virtual void PrintInfo();
    virtual int GetID(void);
    virtual char *GetName();
    virtual bool GetType(int& type);
    virtual bool Serialize(FILE *fp);
    virtual IGoodsPlugin* Deserialize(FILE *fp);
};

class objMask: public IGoodsPlugin
{
public:
    objMask();
    virtual ~objMask();
    virtual void Print();
    virtual void PrintInfo();
    virtual int GetID(void);
    virtual char *GetName();
    virtual bool GetType(int& type);
    virtual bool Serialize(FILE *fp);
    virtual IGoodsPlugin* Deserialize(FILE *fp);
};

class objRedWine: public IGoodsPlugin
{
public:
    objRedWine();
    virtual ~objRedWine();
    virtual void Print();
    virtual void PrintInfo();
    virtual int GetID(void);
    virtual char *GetName();
    virtual bool GetType(int& type);
    virtual bool Serialize(FILE *fp);
    virtual IGoodsPlugin* Deserialize(FILE *fp);
};